package com.mycompany.user.controller;

import com.mycompany.user.entity.User;
import com.mycompany.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by Jintao_Ma on 2017/9/3.
 */
@Controller
public class WebAction {

    @Autowired
    private UserService userService;

    /**
     * System登录
     * @param user
     * @return
     */
    @RequestMapping("/login")
    public ModelAndView login(User user){
        return userService.login(user);
    }

    /**
     * System登录
     * @param user
     * @return
     */
    @RequestMapping("/main")
    public ModelAndView main(User user){
        return userService.getMain(user);
    }

}
